The present invention relates generally to the data processing field, and more particularly, relates to a method, driver and computer program product for sequential operation caching.
Many categories of handheld communications, entertainment and mobile computing devices are known. Many of these devices include a large capacity drive. Often these devices are battery powered during operation.
Problems with such known devices are high power consumption and correspondingly short battery life. For example, operation of an atadisk.dll driver provided with the Microsoft(copyright) Windows(copyright) CE operating system results in short battery life. The problem with the base driver is that when streaming data from the associated drive, such as while playing MP3 compression format music, the drive remains on during the entire playtime. This causes the batteries of the Windows CE device to run out quickly. The purpose of using a large capacity drive is defeated. There is little point in being able to store several hours of music on a drive if the batteries only last 30 minutes.
A need exists for a mechanism that enables improved power consumption requirements and correspondingly improved battery life for handheld communications, entertainment and mobile computing devices.
A principal object of the present invention is to provide a method, driver and computer program product for sequential operation caching. Other important objects of the present invention are to provide such methods, driver and computer program product for sequential operation caching substantially without negative effect; and that overcome many of the disadvantages of prior art arrangements.
In brief, methods, driver and computer program product are provided for sequential operation caching. When a data request from a requesting program is received, then checking for an empty cache is performed. Responsive to an empty cache, the requested data from a storage device is read into the cache. Then the requested data is read from the cache into the requesting program. Responsive to the cache not being empty, checking for the requested data in the cache is performed. Responsive to identifying the requested data in the cache, checking whether the data request is sequential from a last data request is performed. Responsive to the data request being sequential from a last data request, checking for a full cache is performed. Responsive to the cache not being full, the requested data and additional data are read from the storage device into the cache and the additional data is appended to current cache data. Then the requested data is read from the cache into the requesting program. Responsive to a full cache, the requested data is read from the cache into the requesting program.
In accordance with features of the invention, once the cache is full, no further requests are sent to the storage device until all of the data in the cache has been used. Then the cache is emptied and the sequence is repeated.